Repository navigation
Add support for Qwen3-VL-MoE models - #322
Merged
Merged
Conversation
davidkoski
reviewed
Jul 31, 2026
Comment on lines
-576
to
+588
| _activation.wrappedValue = GELU(approximation: .fast) | ||
| _activation.wrappedValue = GELU( | ||
| approximation: Qwen3VLVision.geluApproximation(for: hiddenAct)) |
Member
There was a problem hiding this comment.
Curiously it looks like this was swapped in the mlx-vlm MOE code. In the HF transformers code both types of models use exact/tanh for PatchMerger/VisionMLP. mlx-vlm MOE seems to swap them (and then this code is out of sync with that, but is actually correct per the HF reference code).
Member
There was a problem hiding this comment.
And it fixes a bug in the non MOE code in that it ignored the config :-)
Member
|
Rebase to main to hopefully get CI to work. |
davidkoski
approved these changes
Jul 31, 2026
davidkoski
left a comment
Member
There was a problem hiding this comment.
Changes look good, thank you!
Member
|
Just waiting on CI. |
div0-space
pushed a commit
to LibraxisAI/mlx-swift-lm
that referenced
this pull request
Nov 29, 2026
…l-explore#322) * Add native Recursive Flint model and strict tool protocol * Represent automatic native protocol constraints in CBv2 * Reuse identical sliding masks within a paged prefill call Within one paged prefill row/call, consecutive eligible query blocks with the same query and visible-key counts have byte-identical Boolean sliding masks: each block's first query sits (visible keys - queries) positions after its first visible key. Retain only the last such mask locally and pass it as the same .array SDPA mask, instead of rebuilding it per block. Span, bidirectional, softcap and Qwen4-indexer paths, cold blocks, one-query tails, arithmetic, 128-query blocking, gather-before-write and page ownership are unchanged. New tests compare exact BF16/FP32 outputs and retained KV against an independent per-block rebuild oracle across cold/wrapped histories (including a prefill gather across the physical ring seam), partial tails, decode and reordered packed rows. Paged A/B through the provider measured about +0.8% at 4K fixed-prompt prefill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
div0-space
pushed a commit
to LibraxisAI/mlx-swift-lm
that referenced
this pull request
Nov 29, 2026
Brings ml-explore#322 (Flint), ml-explore#324, ml-explore#326-ml-explore#330 (CBv2 paged/MTP/SDPA, GPT-OSS), ml-explore#325 and the Nemotron Super fused MTP verify window: SDK main up to the commit d-inference master pins (889fe3c). Main's later ml-explore#331/ml-explore#332 are left out until the provider adopts ml-explore#332's streamed tool-call type. Package.swift pins the cluster mlx-swift 9fe34405 instead of main's 67dc7528; that was the only conflict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
This adds support for the Qwen3-VL-MoE model family in addition to the Qwen3-VL models already supported. I also fixed the GELU approximation type for both models, which is designed to be config-driven.
I verified I get valid output in an integration test:
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes